<?php
    if(is_array($result))
	{
		header('Content-Type: application/json; Charset=UTF-8',true);
		$jsonData = array('page'=>$o_PoRecepcionFN->page,'total'=>$o_PoRecepcionFN->numeroRegistros,'rows'=>array());
		foreach ($result as $key => $obj)
		{
		//If cell's elements have named keys, they must match column names
		//Only cell's with named keys and matching columns are order independent.
			$entry = array('id'=>$obj->getRcpId(),
			    'cell'=>array(			    
			            'RcpId' =>$obj->getRcpId(),
			            'Tipo'=>utf8_encode($obj->getTipo()),
			            'PoNro'=>utf8_encode($obj->getPoNro()),
			            'AlmId'=>utf8_encode($obj->getAlmId()),
			            'ProveedorId'=>$obj->getProveedorId(),
			            'ProveedorNombre'=>$obj->getProveedorNombre(),
			            'FacturaNum'=>$obj->getFacturaNum(),
                                    'DocIngresoNum'=>$obj->getDocIngresoNum(),
			            'FechaDocIngreso'=>$obj->getFechaDocIngreso(),
			            'FechaFactura'=>$obj->getFechaFactura(),
			            'FechaIngreso'=>$obj->getFechaIngreso(),
			            'CreaUsr'=>$obj->getCreaUsr(),
                                    'Estado'=>$obj->getStatus(),
			            'opciones'=>"<img border='0' title='Editar Recep' src='/gourmet-express/trunk/imgs/icons/page_edit.png' onclick=fn_editar('". $obj->getRcpId()."') style='cursor:pointer;'>"
			    ),
			);
			$jsonData['rows'][] = $entry;
		}
		echo json_encode($jsonData);
	}?>